<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="../css/element.css" rel="stylesheet"/>
    <link href="../css/styleindex.css" rel="stylesheet"/>
    <style>

    </style>
</head>
<body style="background:#EFF0F4;">

  <div class="mui-content">
    <div id="vm" class="x-examok" v-cloak>
      <div class="x-header-g" id="header">
        <a class="x-header-arrow" @click="api.closeWin()"></a>
        <div class="x-header-t">{{thlevel}}-{{thname}}</div>
      </div>
      <!--  -->
      <div class="x-pro-list">
        <div class="x-pro-top">任职资格</div>
        <div class="x-pro-desc">
          <div class="x-pmo-de">{{introduce}}</div>
        </div>
      </div>
      <!--  -->
      <div class="x-pro-list">
        <div class="x-pro-top">学习下一级条件</div>
        <div class="x-pro-desc">
          <div class="x-pmo-de">{{next}}</div>
        </div>
      </div>
      <!--  -->
      <div class="x-pro-list">
        <div class="x-pro-top">学习路径</div>
        <div class="x-pro-desc" v-for="item in tabledata" :key="item.key">
          <div class="x-pmo-de">{{item.title}}</div>
          <template>
            <el-table :data="item.study_list">
              <!-- <el-table-column label="序号" width="50" type="index"></el-table-column> -->
              <el-table-column label="学习内容" width="120" fixed>
                <template slot-scope="scope">
                  {{scope.row.content}}
                </template>
              </el-table-column>
              <el-table-column label="学习形式" width="">
                <template slot-scope="scope">
                  {{scope.row.type.toString()}}
                </template>
              </el-table-column>
              <el-table-column label="学习时长" width="">
                <template slot-scope="scope">
                  {{scope.row.times}}h
                </template>
              </el-table-column>
              <el-table-column label="考核形式" width="">
                <template slot-scope="scope">
                  {{scope.row.exam_type.toString()}}
                </template>
              </el-table-column>
            </el-table>
          </template>
        </div>
      </div>
    </div>
  </div>

  <script type="text/javascript" src="../script/vue.js"></script>
  <script type="text/javascript" src="../script/element.js"></script>
  <script type="text/javascript" src="../script/api.js"></script>
  <script type="text/javascript" src="../script/base.js"></script>
	<script>
apiready = function () {
    var tid = api.pageParam.id;
    var tlevel = api.pageParam.level;
    var tname = api.pageParam.name;
    $api.fixStatusBar($api.byId('header'));


    //
    var vm = new Vue({
      el:'#vm',
      data(){
        return{
          thid:'',
          thlevel:'',
          thname:'',
          tabledata:[],
          introduce:'',
          next:'',

        }
      },
      created:function() {
        var that=this;


      },
      mounted:function(){
        var that=this;
        that.thid = tid;
        that.thlevel = tlevel;
        that.thname = tname;

        that.getdata()

      },
      methods: {
        getdata:function(){
          let that=this;
          api.ajax({
            url:baseurl+'api/practice/studyInfo',
            methods:'get',
            data:{
              values:{
                sec: $api.getStorage('apptoken'),
                id:that.thid,
                _ssid:$api.getStorage('jobid')
              }
            }
          },function(ret,err){
            if(ret){
              api.hideProgress();
              console.log(JSON.stringify(ret));
              if(ret.status == 1){
                  that.tabledata = ret.data.list.list;
                  that.introduce = ret.data.list.introduce;
                  that.next = ret.data.list.next;
                  console.log(that.tabledata.length);
                  for(var i=0;i<that.tabledata.length;i++){
                    for(var n=0;n<that.tabledata[i].study_list.length;n++){
                      console.log(JSON.stringify(that.tabledata[i].study_list[n].type));

                    }
                  }

              }else{
                api.toast({
                    msg: ret.msg,
                    duration: 3000,
                    location: 'bottom'
                });
              }
            }else{
              api.hideProgress();
              console.log(JSON.stringify(err));
              api.toast({
                  msg: err.msg,
                  duration: 3000,
                  location: 'bottom'
              });
            }
          })
        },
      }
    })
	}


	</script>
</body>
</html>
